﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace XrmLibrary.MsCrm4Adapter.ConfigFile
{
    public class AdapterConnectionElement : ConfigurationElement
    {
        private const String CrmOrganizationUrlName = "CrmServerUrl";
        [ConfigurationProperty(CrmOrganizationUrlName, DefaultValue = "", IsKey = true, IsRequired = true)]
        public String CrmOrganizationUrl
        {
            get { return (String)base[CrmOrganizationUrlName]; }
            set { base[CrmOrganizationUrlName] = value; }
        }

        private const String CrmDiscoveryUrlName = "CrmDiscoveryUrl";
        [ConfigurationProperty(CrmDiscoveryUrlName, DefaultValue = "", IsKey = false, IsRequired = false)]
        public String CrmDiscoveryUrl
        {
            get { return (String)base[CrmDiscoveryUrlName]; }
            set { base[CrmDiscoveryUrlName] = value; }
        }

        private const String CrmAuthenticationTypeName = "CrmAuthenticationType";
        [ConfigurationProperty(CrmAuthenticationTypeName, DefaultValue = "", IsKey = false, IsRequired = true)]
        public String CrmAuthenticationType
        {
            get { return (String)base[CrmAuthenticationTypeName]; }
            set { base[CrmAuthenticationTypeName] = value; }
        }

        private const String CrmUserNameName = "CrmUserName";
        [ConfigurationProperty(CrmUserNameName, DefaultValue = "", IsKey = false, IsRequired = false)]
        public String CrmUserName
        {
            get { return (String)base[CrmUserNameName]; }
            set { base[CrmUserNameName] = value; }
        }

        private const String CrmPasswordName = "CrmPassword";
        [ConfigurationProperty(CrmPasswordName, DefaultValue = "", IsKey = false, IsRequired = false)]
        public String CrmPassword
        {
            get { return (String)base[CrmPasswordName]; }
            set { base[CrmPasswordName] = value; }
        }
    }
}
